Using SITL with Gazebo
Table of Content
Using SITL with Gazebo#
Install SITL#
git clone --recurse-submodules https://github.com/ArduPilot/ardupilot.git
cd ardupilot
./waf configure --board sitl
./waf copter
cd ArduCopter
../Tools/autotest/sim_vehicle.py --console
Build plugin#
Install the ArduPilot Gazebo Plugin
git clone https://github.com/ArduPilot/ardupilot_gazebo
cd ardupilot_gazebo
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j4
set gazebo environment
export GZ_SIM_SYSTEM_PLUGIN_PATH=$HOME/ardupilot/gz_ws/src/ardupilot_gazebo/build:$GZ_SIM_SYSTEM_PLUGIN_PATH
export GZ_SIM_RESOURCE_PATH=$HOME/ardupilot/gz_ws/src/ardupilot_gazebo/models:$HOME/ardupilot/gz_ws/src/ardupilot_gazebo/worlds:$GZ_SIM_RESOURCE_PATH
Run#
Note
iris_runway.sdf
<scene>
<ambient>1.0 1.0 1.0</ambient>
<background>0.8 0.8 0.8</background>
<!-- <sky></sky> -->
</scene>
gazebo
gz sim -v4 -r iris_runway.sdf
sitl
../Tools/autotest/sim_vehicle.py \
-v ArduCopter \
-f gazebo-iris \
--model JSON \
--console
console
mode guided
arm throttle
takeoff 5
